package com.todo.biz.application.helper.detection.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2024/12/13 19:57
 * @description
 */
@Getter
@AllArgsConstructor
public enum TextRiskLevel {
    HIGH("high", "高风险"),
    MEDIUM("medium", "中风险，建议人工复查"),
    LOW("low", "低风险，可通过");

    private static Map<String, TextRiskLevel> codeMap = Arrays.stream(TextRiskLevel.values()).collect(Collectors.toMap(TextRiskLevel::getCode, e -> e));


    private String code;

    private String desc;

    public static TextRiskLevel getByCode(String code) {
        return codeMap.get(code);
    }
}
